<demo>一行代码实现</demo>
<template>
  <Button @click="showDialog">显示对话框</Button>
</template>

<script lang="ts">
import { openDialog } from "../lib/openDialog";
import Dialog from "../lib/Dialog.vue";
import Button from "../lib/Button.vue";
import { ref, h } from "vue";
export default {
  components: {
    Dialog,
    Button,
  },
  setup() {
    const showDialog = () => {
      openDialog({
        title: h("strong", {}, "标题"),
        content: `对话框内容`,
        ok() {
          console.log("ok");
        },
        cancel() {
          console.log("cancel");
        },
      });
    };
    return { showDialog };
  },
};
</script>
